add_library(nf7_core)
target_link_libraries(nf7_core
  PUBLIC
    git_hash
    imgui
    imgui4lua
    luajit
    nf7_config
    nf7_iface
    OpenGL
    SDL2
    sqlite
    uvw
)
target_sources(nf7_core
  PRIVATE
    gl3/context.cc
    imgui/context.cc
    imgui/luajit_driver.cc
    luajit/context.cc
    luajit/lambda.cc
    luajit/thread.cc
    luajit/value.cc
    sqlite/database.cc
    uv/concurrency.cc
    uv/parallelism.cc
    version.cc
  PUBLIC
    gl3/context.hh
    imgui/context.hh
    imgui/driver.hh
    imgui/luajit_driver.hh
    luajit/context.hh
    luajit/lambda.hh
    luajit/thread.hh
    luajit/value.hh
    sqlite/database.hh
    sqlite/util.hh
    uv/clock.hh
    uv/concurrency.hh
    uv/context.hh
    uv/file.cc
    uv/file.hh
    uv/parallelism.hh
    clock.hh
    dealer.hh
    logger.hh
    meta_env.hh
    version.hh
)

add_executable(nf7_core_test)
target_sources(nf7_core_test
  PRIVATE
    gl3/context_test.cc
    imgui/context_test.cc
    imgui/context_test.hh
    imgui/driver_test.hh
    imgui/luajit_driver_test.cc
    luajit/context_test.cc
    luajit/context_test.hh
    luajit/lambda_test.cc
    luajit/thread_test.cc
    luajit/thread_test.hh
    luajit/value_test.cc
    sqlite/database_test.cc
    sqlite/database_test.hh
    uv/context_test.hh
    uv/concurrency_test.cc
    uv/file_test.cc
    uv/parallelism_test.cc
    clock_test.cc
    env_test.hh
    meta_env_test.cc
)
target_link_libraries(nf7_core_test
  PRIVATE
    nf7_core
    GTest::gmock_main
    GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(nf7_core_test)
